-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix inference unable to run due to JS WASM runtime not being bundled into onnxruntime-web/wasm build
#24836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…dle.min.mjs` as it is for other `bundle.min.mjs` builds
|
need format code |
|
It looks like the E2E tests are failing. please apply this change to fix it. |
|
@microsoft-github-policy-service agree |
|
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
|
Could you please merge to latest main branch, which includes the CI pipeline fix? |
|
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
…into `onnxruntime-web/wasm` build (microsoft#24836) ### Description Fixes inference error from `ort-wasm-simd-threaded.mjs` not being bundled into `ort.wasm.bundle.min.mjs` as it is for other `bundle.min.mjs` builds. ### Motivation and Context To decrease my app's bundle size, I followed the [conditional importing guide](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js/importing_onnxruntime-web#conditional-importing) and imported the WASM-only build: ```diff - import * as ort from 'onnxruntime-web'; + import * as ort from 'onnxruntime-web/wasm'; ``` After this change, creating an inference session would result in: `TypeError: Failed to resolve module specifier './ort-wasm-simd-threaded.mjs'`. This was because `ort-wasm-simd-threaded.mjs` was not bundled into the build at `onnxruntime-web/wasm`, which points to `ort.wasm.bundle.min.mjs`, despite how its name suggests. In other builds with `bundle` in their name, the module is bundled, yet it was not done so in the WASM one. This PR bundles the Javascript WASM runtime in to match the other builds, fixing the error.
Description
Fixes inference error from
ort-wasm-simd-threaded.mjsnot being bundled intoort.wasm.bundle.min.mjsas it is for otherbundle.min.mjsbuilds.Motivation and Context
To decrease my app's bundle size, I followed the conditional importing guide and imported the WASM-only build:
After this change, creating an inference session would result in:
TypeError: Failed to resolve module specifier './ort-wasm-simd-threaded.mjs'.This was because
ort-wasm-simd-threaded.mjswas not bundled into the build atonnxruntime-web/wasm, which points toort.wasm.bundle.min.mjs, despite how its name suggests. In other builds withbundlein their name, the module is bundled, yet it was not done so in the WASM one. This PR bundles the Javascript WASM runtime in to match the other builds, fixing the error.